<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title> mathlab interactive documentation</title>

  <link rel="stylesheet" type="text/css" href="https://storage.googleapis.com/app.klipse.tech/css/codemirror.css">
    <link rel="stylesheet" type="text/css" href="https://viebel.github.io/klipse/css/main.css">

</head>

<body class="container">

<h1> mathlab interactive documentation</h1>


<p>The documentation is <strong>live</strong> and <strong>interactive</strong>
powered by the <a href="https://github.com/viebel/klipse">klipse plugin</a>:</p>

<ol>
  <li><strong>Live</strong>: The code is executed in your browser</li>
  <li><strong>Interactive</strong>: You can modify the code and it is evaluated as you type</li>
</ol>

<h2> Setup </h2>
First let's load <code>mathlab</code> from the <a href="https://github.com/timqian/mathlab">mathlab github repository</a> (It might take a couple of seconds...):

<br/>
<br/>
<pre><code class="js" data-external-libs="https://raw.githubusercontent.com/timqian/mathlab/master/dist/mathlab.min.js">
  Object.keys(mathlab)
</code></pre>

<h2>  Matrix Manipulation</h2>

<h3> Matrix inverse</h3>
<p>
  <code>inv</code> calculates the inverse of a matrix.
</p>
<pre><code class="js">
mathlab.inv([[1,2],[3,4]])
</code></pre>

<p>And here is what happens when the matrix is not invertible:</p>
<pre><code class="js">
mathlab.inv([[1,2],[1,2]])
</code></pre>

<h2>  Dot Product</h2>

<p>
  <code>dot</code> calculates the dot product of a matrix.
</p>
<pre><code class="js">
 mathlab.dot([[1, 1], [2, 1]], [1, 2])
</code></pre>


<script>
    window.klipse_settings = {
       selector_eval_js: '.js',
       codemirror_options_out: {
        lineWrapping: true
       }
    };
</script>



<script src="https://storage.googleapis.com/app.klipse.tech/plugin_prod/js/klipse_plugin.min.js"></script>
</body>

</html>
